package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteOrderService;
import com.ruoyi.system.api.domain.TOrderMainList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * @author sss
 * @description 工单管理服务降级
 * @date 2022/7/27
 */
public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteOrderFallbackFactory.class);

    @Override
    public RemoteOrderService create(Throwable throwable) {
        log.error("调用工单服务失败:{}", throwable.getMessage());
        return new RemoteOrderService() {
            @Override
            public void createMessage(TOrderMainList tOrderMainList) {

            }
        };
    }
}
